<?php

namespace app\index\controller;
use think\Db;
use think\Controller;
use think\Request;
use think\Session;


class Index extends Controller
{
    public function index()
    {	
    	//banner图的
    	$xlist=Db::table('hc_banner')->select();
    	//分类的
    	$clist = Db::table('sorted')->select();
    	//公告的
    	$xii=Db::table('hc_notice')->select();
        //前台分类的书
        $nlist=Db::table('novel_content')
        ->order(['sid' => 'DESC'])
        ->limit(6)
        ->where('type',1)
        ->select();
        

     

        $ranklist = Db::table('novel_content')->order('sclick desc')->select();
        $adj_list = Db::table('adj')->select();
    	
    	// var_dump($xii[time]);die;
    	// var_dump($xii);die;
        return view('index/index',[
            'xlist' => $xlist,
            'clist' => $clist,
            'xii' => $xii,
            'rank_list' => $ranklist,
            'adj_list' => $adj_list,
            'nlist' => $nlist,
            




        ]);
    }
     public function logout()
    {   
        
        // var_dump('到退出登录这里了');die;
         Session::clear('');
          // var_dump($_SESSION);die;
         return $this->success('退出成功',url('/'));
    }
}
